<!-- 数字人使用记录消息页面-->

<template>
  <view :style="themeColor">
    <view class="page">
      <CHead :title="navtt" isParentBack :showPlac="false" />
      <!-- 音频下载（文字转语音）（废弃保存的内容APP找不到） -->
      <AudioSave v-model="isShowAudioDown" />
      <!-- 无问答题次数提示 -->
      <NotSendNotice v-model="isShowNotSendNumNotice" />
      <!-- 会话列表 -->
      <Session v-model="isShowSession" ref="session" :usedId="usedId" :sceneId="sceneId"
        @changeCSession="changeCSession" @notSession="notSession"
        @updateSessionTitlteSuccess="updateSessionTitlteSuccess" />
      <!-- 消息选项 -->
      <MsgOption ref="msgOption" @confirm="fastTiwen" />
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-center benben-flex-layout simplifiedPaper_flex_5">
        <!-- 页面滚动箭头 -->
        <view class='flex flex-wrap align-center simplifiedPaper_fd5_0'>
          <image class='simplifiedPaper_fd5_0_c0' mode="aspectFit" :src='STATIC_URL+"64.png"'
            @click="$refs.cmList.offsetTop()"></image>
        </view>
        <view class='flex flex-wrap align-center simplifiedPaper_fd5_1'>
          <image class='simplifiedPaper_fd5_0_c0' mode="aspectFit" :src='STATIC_URL+"65.png"'
            @click="$refs.cmList.offsetetBttom()"></image>
        </view>
        <!-- 消息列表内容 -->
        <ChatMsgList ref="cmList" :list="msgList" :getMoreLoading.sync="pageLoading" @getMore="getMoreMsgFn">
          <view class="item_box" v-for="(item,index) in msgList" :key="item.aid">
            <view v-if="item">
              <view class='flex flex-direction flex-wrap align-center'>
                <view class='flex flex-direction align-stretch simplifiedPaper_fd5_2_c0'>
                  <scroll-view scroll-x style="width: 100%;">
                    <view class='flex align-start simplifiedPaper_fd5_2_c0_c0'>
                      <image class='simplifiedPaper_fd5_2_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"60.png"'></image>
                      <view v-if="item.problem_new">
                        <view v-for="(item1,index1) in item.problem_new" :key="index1"
                          class='simplifiedPaper_fd5_2_c0_c0_c1' style="height: 60rpx;">
                          <text style="opacity: 0.8;">{{item1.key }}：</text>
                          <text>{{item1.value}}</text>
                        </view>
                      </view>
                      <text class='simplifiedPaper_fd5_2_c0_c0_c1' v-else>{{item.problem}}</text>
                    </view>
                    <view v-if="sendLoading && !item.answer && index == msgList.length-1"
                      class='flex align-start simplifiedPaper_fd5_2_c0_c0'>
                      <image class='simplifiedPaper_fd5_2_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"61.png"'></image>
                      <view class="guangbiao" />
                    </view>
                    <view v-else-if="item && item.answer" class='flex align-start simplifiedPaper_fd5_2_c0_c0'>
                      <image class='simplifiedPaper_fd5_2_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"61.png"'></image>
                      <view class="simplifiedPaper_fd5_2_c0_c1_c1">
                        <!-- {{item.answer}} -->
                        <CText v-if="sendLoading && index == msgList.length-1" :text="renderMsg" />
                        <view :class="{content_hide:sendLoading && index == msgList.length-1}">
                          <zero-markdown-view :markdown="item.answer"></zero-markdown-view>
                        </view>
                      </view>
                    </view>
                    <view v-else class='flex align-start simplifiedPaper_fd5_2_c0_c0'>
                      <image class='simplifiedPaper_fd5_2_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"61.png"'></image>
                      <view class="simplifiedPaper_fd5_2_c0_c1_c1" style="margin: -4rpx;">
                        抱歉我无法回答您此类问题
                      </view>
                    </view>
                  </scroll-view>
                  <!-- 控制台 -->
                  <!-- #ifdef MP-WEIXIN -->
                  <view v-if="item && item.answer" class='flex flex-wrap align-center justify-between'
                    style="box-sizing: border-box;padding:32rpx 36rpx 0 48rpx;">
                  <!-- #endif -->
                    <!-- #ifndef MP-WEIXIN -->
                    <view v-if="item && item.answer" class='flex flex-wrap align-center justify-between'
                      style="box-sizing: border-box;padding:0 36rpx 0 48rpx;">
                    <!-- #endif -->

                      <!-- 音频文件存储小程序和APP存储找不到 -->
                      <!-- @click.stop="isShowAudioDown=true" -->
                      <view v-if="item.createAudioLoading" class="flex align-center"
                        style="color: #fff;font-size: 24rpx;">
                        <!-- <u-loading /> -->
                        <text style="margin-left: 20rpx;">语音生成中...</text>
                      </view>
                      <view class="flex align-center flex-sub" style="box-sizing: border-box;padding-right: 32rpx;"
                        v-else>
                        <image class='simplifiedPaper_fd5_2_c0_c2_c0' mode="aspectFit" :src='STATIC_URL+"66.png"'
                          @click.stop="downAudio(item)"></image>
                        <view v-if="item.isPlayingAudio" class='simplifiedPaper_fd5_2_c0_c2_c1'
                          @click.stop="stopAudioPlay(item)">
                          <u-image width="100%" height="100%" lazy-load :src='STATIC_URL+"172.png"' />
                        </view>
                        <view v-else class='simplifiedPaper_fd5_2_c0_c2_c1' @click.stop="playAudio(item,index)">
                          <u-image width="100%" height="100%" border-radius="8rpx" lazy-load
                            :src='STATIC_URL+"173.png"' />
                        </view>
                        <view style="flex:1;">
                          <AudioCorrugation v-if="item.isPlayingAudio" :cHeight="40" :heightList="audioHeightList" />
                        </view>
                      </view>
                      <view v-if="item && item.answer" class="flex align-center" style="flex-shrink: 0;">
                        <view class="simplifiedPaper_fd5_2_c0_c2_c2" style="margin-right: 32rpx;" :data-type="item"
                          @click="shareForum(item)">
                          <u-image width="100%" height="100%" lazy-load :src='STATIC_URL+"308.png"' />
                        </view>
                        <view v-if="IS_OPEN_SEND_PROBLEM" class="simplifiedPaper_fd5_2_c0_c2_c2"
                          style="margin-right: 32rpx;" :data-type="item" @click="jubaoFn(item)">
                          <u-image width="100%" height="100%" lazy-load :src='STATIC_URL+"178.png"' />
                        </view>
                        <view class="simplifiedPaper_fd5_2_c0_c2_c2" :data-type="item" @click="$refs.cmList.ccopyFn">
                          <u-image width="100%" height="100%" lazy-load :src='STATIC_URL+"63.png"' />
                        </view>
                      </view>
                    </view>
                  </view>
                  <!-- 停止(只作用于最后一条数据) -->
                  <view v-if="sendLoading && index == msgList.length-1" @click="stopTiwenFn"
                    class='flex flex-wrap align-center justify-center simplifiedPaper_fd5_2_c1'>
                    <text class='simplifiedPaper_fd5_2_c1_c0'>停止</text>
                  </view>
                  <!-- 继续 -->
                  <view v-if="(!sendLoading || index < msgList.length -1) && item.answer && IS_OPEN_SEND_PROBLEM"
                    class='flex flex-wrap align-center justify-center simplifiedPaper_fd5_2_c2'
                    @click.stop="fastTiwenCMsgId=item.msg_id,$refs.msgOption.open($event)">
                    <text class='simplifiedPaper_fd5_2_c2_c0'>继续</text>
                    <image class='simplifiedPaper_fd5_2_c2_c1' mode="aspectFit" :src='STATIC_URL+"67.png"'></image>
                  </view>
                  <!-- 重试 -->
                  <view v-if="(!sendLoading || index < msgList.length - 1) && !item.answer && IS_OPEN_SEND_PROBLEM"
                    class='flex flex-wrap align-center justify-center simplifiedPaper_fd5_2_c1'
                    @click.stop="fastTiwenCMsgId=item.msg_id,fastTiwen(item.problem)">
                    <text class='simplifiedPaper_fd5_2_c1_c0'>重试</text>
                  </view>
                </view>
              </view>
              <view v-else>--</view>
            </view>
            <!-- <view slot="top_other">
						<view :style="{height:(88+StatusBarRpx)+'rpx' }"></view>
					</view> -->
            <view slot="other">
              <image v-if="empty" :src="STATIC_URL + '174.png'" mode="aspectFit"
                style="width: 345rpx;height:257rpx;margin: 24vh auto 0;display: block;"></image>
              <!-- 音频容器 -->
              <audio controls autoplay loop style="height:0;min-height:0;opacity: 0;display: block;" />
              <!-- 安全距离 -->
              <view v-if="IS_OPEN_SEND_PROBLEM"
                style="height: calc(100rpx + calc(24rpx + env(safe-area-inset-bottom));" />
            </view>
        </ChatMsgList>


        <!-- 会话显示箭头 -->
        <view v-if="isWanneng && !sendLoading" class='flex flex-wrap align-center simplifiedPaper_fd5_3'
          @click.stop="isShowSession=true">
          <image class='simplifiedPaper_fd5_3_c0' mode="aspectFit" :src='STATIC_URL+"68.png"'></image>
        </view>
        <!-- 输入框 -->
        <view v-if="IS_OPEN_SEND_PROBLEM" class='flex  simplifiedPaper_fd5_4'>
          <image class='simplifiedPaper_fd5_4_c0' mode="aspectFit" :src='STATIC_URL+"51.png"'
            @click="openAudioIdentity"></image>
          <view class='flex flex-wrap align-center simplifiedPaper_fd5_4_c1'>
            <scroll-view scroll-y scroll-with-animation style="max-height: 300rpx;">
              <textarea v-if="!iptIsDisabled" type="text" :placeholder="`请输入你的问题…`" confirm-type="done" :maxlength="-1"
                placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx" auto-height
                :disabled="sendLoading || iptIsDisabled" v-model.trim="problem" ref="textDom" />
            </scroll-view>
          </view>
          <view v-if="sendLoading" class="simplifiedPaper_fd5_4_c2"
            style="display: flex;align-items: center;justify-content: center;">
            <!-- <u-loading color="#ffffff" /> -->
          </view>

          <image v-else class='simplifiedPaper_fd5_4_c2' mode="aspectFit" :src='STATIC_URL+"50.png"' @click="sendMsg">
          </image>
        </view>
      </view>

    </view>

    <!-- 语音识别 -->
    <AudioIdentify v-model="isShowAudioIdentify" @confirm="audioIdentifyConfrim" />
    <!-- 去设置语音配置 -->
    <u-modal v-model="toConfirmAudioConfig" title="提示" content="您还没有设置声音模型，无法播放/下载音频，是否现在去设置？" confirm-text="去设置"
      show-cancel-button @cancel="toConfirmAudioConfig=false" @confirm="toConfirmAudioConfigFn"></u-modal>

    <!-- #ifndef MP-WEIXIN -->
    <AppLiuShi ref="appLiushi" :msg="gptProblem" @processBack="processBackFn" @gptLastBack="gptLastBackFn"
      @gptErrBack="gptErrBackFn"></AppLiuShi>
    <!-- #endif -->

    <!-- 举报 -->
    <Jubao ref="jubao" />

  </view>
</template>
<script>
  import Jubao from "./_components/Jubao.vue"
  import {
    ChatUtils
  } from '@/common/gpt/chatUtils';
  import AudioSave from './_components/AudioSave.vue';
  import NotSendNotice from './_components/NotSendNotice.vue'
  // import AudioIdentify from './_components/AudioIdentify.vue'
  import Session from './_components/Session.vue'
  import MsgOption from './_components/MsgOption.vue'
  import CText from './_components/CText.vue'
  import AudioModuleConfig from './_components/AudioModuleConfig.vue';
  import {
    wannengMixin
  } from './wannengMixin'
  import {
    GPT_PERSON_TYPE,
    GPT_VERSION,
    HOME_MODULE_TYPE
  } from '@/const';
  import {
    minganciBiaoshu
  } from '@/common/gpt/type';
  import ChatMsgList from './_components/ChatMsgList.vue';
  import {
    GPT_IT_END
  } from '@/const'
  import {
    otherSceneMixin
  } from './otherSceneMixin'
  import {
    AudioCorrugationUtils
  } from '@/common/customUtils/AudioCorrugationUtils'
  import {
    msgRenderMixin
  } from "./msgRenderMixin"
  export default {
    mixins: [wannengMixin, otherSceneMixin, msgRenderMixin, ],
    components: {
      AudioSave,
      NotSendNotice,
      // AudioIdentify,
      Session,
      MsgOption,
      CText,
      ChatMsgList,
      AudioModuleConfig,
      Jubao,
    },
    data() {
      return {
        GPT_IT_END,
        gptProblem: "", // gpt问题
        // 万能场景类型
        WANNENG_TYPE_DEF: 1,
        "isShowSession": false,
        "isShowNotSendNumNotice": false,
        "isShowAudioDown": false,
        "problem": "",
        cSessionId: "",
        cSessionTitle: "", // 当前场景标题
        sceneId: "", // 场景ID
        sendLoading: false,
        msgList: [], // 消息列表 （数据结构详见wannengMixin文件头部）
        getMoreLoading: true, // 列表数据加载
        pageLoading: true,
        empty: false,
        page: 1,
        isHaveMore: true, // 是否拥有更多
        audioObj: null,
        fastTiwenCMsgId: "", // 需要快速提问的gpt数据ID
        audioHeightList: [], // 声音波纹数据
        isShowAudioIdentify: false, // 是否显示录音识别
        isSetAudioConfig: false, // 是否有设置过声音模型
        toConfirmAudioConfig: false, // 是否显示确认音频配置
        navtt: "对话记录", // 导航名称
        othersceneProblem: "", // 其他场景进入时问题
        isOpenEmptySessionRequest: false, // 是否开启空会话请求

        demoOptions: {}, // 入参测试
        iptIsDisabled: false, // 用于处理页面离开时失去焦点
        /** 临时gpt列表数据字符串 */
        tempGptProblemJson: "",
        /** 是否打开提问功能 */
        IS_OPEN_SEND_PROBLEM: false,
        /** 使用中的会话 */
        usedId: "",
      };
    },
    computed: {
      /** 是否是万能场景(这里直接按照指定场景ID进行逻辑实现) */
      isWanneng() {
        return true
      },
      /** 是否开启gpt4 */
      isOpenGpt4() {
        return this.$store.state.cHomeModule == HOME_MODULE_TYPE.GPT4
      },
      /** 当前gpt版本 */
      cGptVersion() {
        if (this.$store.state.cHomeModule == HOME_MODULE_TYPE.GPT4) return GPT_VERSION.FOUR
        return GPT_VERSION.THREE;
      },
    },
    /**
     * @param {Object} options 页面入参（sceneId 场景ID【默认万能场景】；v 当前gpt版本（默认3.5））
     */
    onLoad(options) {
      // this.navtt = options.navTitle || "对话记录";
      this.othersceneProblem = options.problem || "";
      try {
        this.demoOptions = options; // 入参测试
        this.sceneId = options.id || 1;
        this.usedId = options.usedId || "";
        this.$nextTick(() => {
          this.audioObj = new AudioCorrugationUtils(
            40,
            list => this.audioHeightList = list,
            _ => this.msgList.map(item => item.isPlayingAudio = false),
          );
        })
        this.$nextTick(() => {
          this.$refs.session.getSessionListFirst()
        })
        // console.debug("simplified paper onload")
        // if (this.sceneId != this.WANNENG_TYPE_DEF) {
        // 	this.getMsgList();

        // 	if (options.problem) {
        // 		this.problem = options.problem;
        // 		this.sendMsg();
        // 	}

        // 	this.tempGptProblemJson = uni.getStorageSync("tempGptProblemJson") || "";
        // 	uni.removeStorageSync("tempGptProblemJson")
        // }
      } catch (e) {
        this.demoOptions = JSON.stringify(e || {})
      }
    },
    onShow() {
      // 获取音频配置
      this.getUserConfigAudioModel();
    },
    onHide() {
      this.iptIsDisabled = true;
      setTimeout(() => {
        this.iptIsDisabled = false
      }, 100)
    },
    onUnload() {
      this.audioObj.destroyTimer();
      this.audioObj.pause();
    },
    methods: {
      /** 分享到论坛 */
      shareForum(info = {}) {
        console.log(info);
        const {
          problem,
          answer
        } = info;
        uni.setStorageSync("OPEN_FORUM_DATA", {
          problem,
          answer,
          type: 1
        })
        uni.navigateTo({
          url: "/pages/grzx/sendForum/sendForum"
        })
      },
      /** 去举报 */
      jubaoFn(info = {}) {
        this.$refs.jubao.open({
          record_id: info.aid,
          isWanneng: this.isWanneng,
        })
      },
      /** 无会话回调 */
      notSession() {
        this.msgList = [];
        this.pageLoading = false;
        this.empty = true;
        this.page = 1;
        this.cSessionId = "";
      },
      /** 阶段返回 */
      processBackFn(res) {
        if (this.problem) this.problem = "";
        this.msgList[this.msgList.length - 1].answer = res.result;
        this.msgList[this.msgList.length - 1].msg_id = res.id;
        this.renderMiddleFn(res.result, this._isRenderEnd = res.isEnd);
        var is_end = 0;
        if (res.isEnd) is_end = 1;
        this.msgList[this.msgList.length - 1].is_end = is_end;
        this.viewLastMsg();
        // console.debug("processBackCtn", res);
      },
      /** 最后返回 */
      gptLastBackFn(res) {
        var is_end = 0;
        if (res.isEnd) is_end = 1;
        this.msgList[this.msgList.length - 1].is_end = is_end;
        if (res.result == minganciBiaoshu) {
          this.msgList[this.msgList.length - 1].answer = '无效内容';
          this.msgList[this.msgList.length - 1].is_end = 1;
          this.renderMiddleFn("无效内容", this._isRenderEnd = true);
        }
        this.problem = "";
        console.log(this.isWanneng);
        if (this.isWanneng) this.wnDaanSave();
        else this.osDaanSave();
        console.debug("gptLastBackCtn", res);
      },
      /** 错误返回 */
      gptErrBackFn(e) {
        // this.problem = prompt;
        this.$msg(e?.msg || '提问失败');
        if (this.isWanneng) this.wnTiwenFailFn();
        else this.osTiwenFailFn();
        // console.debug("gptErrBackCtn", res);
      },
      /** 确认去设置音频模型逻辑 */
      toConfirmAudioConfigFn() {
        this.toConfirmAudioConfig = false;
        uni.navigateTo({
          url: "/pages/mine/soundModel/soundModel"
        })
      },
      /** 获取用户设置的声音模型 */
      async getUserConfigAudioModel() {
        const res = await this.$post('652687c5969f2');
        this.isSetAudioConfig = !!res.data.voicemodel_id;
      },
      /** 开启语音识别 */
      openAudioIdentity() {
        if (this.sendLoading) return;
        this.isShowAudioIdentify = true;
      },
      /** 语音识别确认 */
      audioIdentifyConfrim(result) {
        this.problem = result;
        this.sendMsg();
      },
      /** 获取历史对话 */
      getMoreMsgFn() {
        if (this.isHaveMore) {
          this.page += 1;
          if (this.isWanneng) this.wnGetMsgList();
          else this.osGetMsgList();
        }
      },
      /** 获取问答记录 */
      async getMsgList() {
        this.page = 1;
        this.empty = false;
        this.pageLoading = true;
        if (this.isWanneng) await this.wnGetMsgList(1);
        else await this.osGetMsgList(1);
        this.empty = !this.msgList.length;
        this.pageLoading = false;
      },
      /** 获取是否有提问机会 */
      async getMayIaskAQuestion() {
        var type, flag = true;
        try {
          if (this.isOpenGpt4) type = '2';
          else type = '1';
          const res = await this.$post('6537151b709ef', {
            type
          });
          flag = res.data.status > 0;
          // if (!flag) this.$refs.showxianNotice.showFn();
          if (!flag) this.isShowNotSendNumNotice = true;
        } catch (error) {
          flag = false;
        }
        return flag;
      },
      /** 发送问题进行提问 */
      async sendMsg() {
        if (this.sendLoading) return;
        if (!this.problem) return this.$msg('请输入您的问题...');
        const _mayIaskAQuestionawait = await this.getMayIaskAQuestion();
        if (!_mayIaskAQuestionawait) return;
        this.sendLoading = true;
        if (this.isWanneng) {
          if (!this.cSessionId) {
            this.isOpenEmptySessionRequest = true;
            await this.$refs.session.addSession(this.problem);
          } else setTimeout(() => this.wnSendMsgGen.next(), 1)
        } else this.osSendMsgGen.next();
      },
      /** 显示最后一条消息 */
      viewLastMsg() {
        this.$nextTick(() => {
          const dom = this.$refs.cmList
          dom && dom.offsetetBttom();
        })
      },
      /** 滚动到加载更多数据之前 */
      scrollToBeforeMore() {
        this.$nextTick(() => {
          const dom = this.$refs.cmList
          dom && dom.scrollToBeforeMore();
        })
      },
      /** 停止提问 */
      stopTiwenFn() {
        // if (this.isWanneng) this.wnStopTiwenFn();
        // else this.osStopTiwenFn();
        const dom = this.$refs.appLiushi;
        dom && dom.cancelFn();
        this.sendLoading = false;
        if (this.isWanneng) this.wnSendMsgGen = this.createWnTiwenHandler();
        else this.osSendMsgGen = this.createOsTiwenHandler();
      },
      /** 快速提问（根据关键字直接提问） */
      fastTiwen(problem = "") {
        if (this.sendLoading) return; // 提问期间不许再问
        this.problem = problem;
        this.sendMsg();
      },
      /** 下载解答语音 */
      async downAudio(info = {}) {
        var {
          audio_url
        } = info;
        if (!audio_url) {
          const {
            url,
            isSuccess
          } = await this.createAudio(info);
          if (!isSuccess) return this.toConfirmAudioConfig = true;
          if (url) {
            audio_url = url;
            info.audio_url = audio_url;
          } else this.$msg('语音生成中，请稍后再试')
        }
        if (audio_url)
          uni.setClipboardData({
            data: audio_url,
            success: _ => this.$msg(`音频地址已复制到剪切板，请于浏览器进行下载`)
          })
      },
      /** 生成音频文件 */
      async createAudio(item = {}) {
        if (item.createAudioLoading) return;
        if (!this.isSetAudioConfig) return {
          isSuccess: false
        };
        const _info = this.msgList.find(it => it.aid == item.aid);
        _info.createAudioLoading = true;
        var result = false;
        var isSuccess = true;
        try {
          const res = await this.$post('6526525d6eeb3', {
            aid: item.aid,
            text: item.answer,
            gpt_type: this.sceneId == this.WANNENG_TYPE_DEF ? 1 : 2,
          });
          // const res = { data: { url: 'http://hongchen.natapp4.cc/demo_yinyue.m4a' } }
          result = res.data.url;
          _info.audio_url = result;
          // this.playAudio(_info);
          result && this.saveMsgAudioUrl(item.aid, result);
        } catch (e) {
          this.$msg(e?.msg || '生成音频文件')
        }
        _info.createAudioLoading = false;
        return {
          url: result,
          isSuccess
        };
      },
      /** 保存聊天记录语音地址 */
      async saveMsgAudioUrl(...arge) {
        const [record_id, audio_url] = arge;
        try {
          var apiUrl = '6520b68e5566f';
          if (!this.isWanneng) apiUrl = '65221ff060420';
          await this.$post(apiUrl, {
            record_id,
            audio_url
          });
        } catch (e) {
          console.debug('保存聊天记录语音地址失败', e)
        }
      },
      /** 播放回答内容 */
      async playAudio(info = {}, index) {
        try {
          var {
            audio_url
          } = info;
          if (!audio_url) {
            const {
              url,
              isSuccess
            } = await this.createAudio(info);
            if (!isSuccess) return this.toConfirmAudioConfig = true;
            if (url) audio_url = url;
            else this.$msg('语音生成中，请稍后再试')
          }
          if (audio_url) {
            try {
              this.msgList.map(item => {
                item.isPlayingAudio = false;
              })
            } catch (e) {}
            info.isPlayingAudio = true;
            info.audio_url = audio_url;
            this.audioObj.play(info.audio_url);
          }

          this.demoOptions = 'play success';
        } catch (e) {
          // 测试代码
          this.demoOptions = JSON.stringify(e || {});
        }
      },
      /** 停止播放回答内容 */
      stopAudioPlay(info = {}) {
        if (this.audioObj) {
          this.audioObj.pause();
          info.isPlayingAudio = false;
        }
      },
    }
  };
</script>

<style lang="scss" scoped>
  @import './digitalPersonUseMessage.scss';

  ::v-deep .zero-markdown-view {
    padding: 0 !important;
    margin-top: -20rpx;
  }
</style>
